/** * Main requirejs config file * @param {object} root window / global * @param {function} factory function definition * @return {object} requirejs configuration * @todo use flat folder structure */ (function(root, factory) { 'use strict'; // flag to use distribution folder for features / modules root.launchpad = root.launchpad || {}; root.launchpad.config = root.launchpad.config || { usemin: true }; var USEMIN = Boolean(root.launchpad.config.usemin); var DIST = USEMIN ? 'dist/' : ''; var host; if (typeof exports === 'object') { host = require('os').hostname(); module.exports = factory(root, ''); } else if (typeof requirejs === 'function') { require.config(factory(root, DIST)); host = root.location.host; } if(!USEMIN && host.indexOf('local') > -1) { console.warn('You are using unminified version of modules/features !!! @', host); } }(this, function(root, dist) { 'use strict'; var path = root.launchpad.config.path || 'features/[BBHOST]'; var config = { baseUrl: (function(launchpad) { return launchpad.staticRoot || './'; })(root.launchpad || {}), paths: { /** * Common libs */ // utility belt 'lodash' : [ path + '/lodash/lodash.min', path + '/lodash/lodash' ], // fetch 'fetch' : [ path + '/fetch/fetch'], // Mobile and gestures 'hammerjs' : [ path + '/hammerjs/hammer.min', path + '/hammerjs/hammer' ], // date 'moment' : [ path + '/moment/min/moment.min', path + '/moment/moment' ], // graphics and animation 'd3' : [ path + '/d3/d3.min', path + '/d3/d3' ], // IE8 dependensies for charts including SVG polyfills 'uislider' : [ path + '/uislider/nouislider'], 'roundslider' : [ path + '/roundslider/roundslider.min'], 'r2d3' : [ path + '/module-polyfills/scripts/r2d3', path + '/module-polyfills/scripts/r2d3'], 'aight' : [ path + '/module-polyfills/scripts/aight', path + '/module-polyfills/scripts/aight'], // Template-ing systems 'handlebars' : [ path + '/handlebars/handlebars.min', path + '/handlebars/handlebars' ], // angular & 3rd party ng libs 'angular' : [ path + '/angular/angular.min', path + '/angular/angular' ], 'angular-resource' : [ path + '/angular-resource/angular-resource.min' ], 'angular-translate' : [ path + '/angular-translate/angular-translate.min' ], 'angular-dynamic-locale' : [ path + '/angular-dynamic-locale/tmhDynamicLocale.min' ], 'angular-sanitize' : [ path + '/angular-sanitize/angular-sanitize.min' ], 'n3-pie-chart': [path + '/n3-charts.pie-chart/dist/pie-chart.min'], 'rzModule': [path + '/angularjs-slider/rzslider.min'], // Personal Loan changes 'reTree': path + '/re-tree/re-tree', 'ng-device-detector-master': path + '/ng-device-detector-master/ng-device-detector.min', 'angular-touch' : [path + '/angular-touch/angular-touch.min'], 'uiSwitch' : [path + '/angularjs-switch/angular-ui-switch.min'], 'angular-carousel' : [path + '/angular-carousel/angular-carousel.min'], 'idfc-module-md5' : [path + '/angular-md5'], // LP foundation 'base' : path + '/base/' + dist + 'scripts', 'core' : path + '/core/' + dist + 'scripts', //'base' : path + '/base/' + 'scripts', //'core' : path + '/core/' + 'scripts', 'ui' : path + '/ui/' + 'scripts', 'mock' : path + '/mock/dist/scripts', // LP modules 'module-currencies' : path + '/module-currencies/'+ dist +'scripts', 'module-accounts' : path + '/module-accounts/'+ dist +'scripts', 'module-automation' : path + '/module-automation/'+ dist +'scripts', 'module-estatements' : path + '/module-estatements/'+ dist +'scripts', 'module-payments' : path + '/module-payments/'+ dist +'scripts', 'idfc-bb-module-payments' : path + '/idfc-bb-module-payments/'+'scripts', 'module-users' : path + '/module-users/' +'scripts', 'module-wealth' : path + '/module-wealth/'+ dist +'scripts', 'module-freshness' : path + '/module-freshness/'+ dist +'scripts', 'module-tags' : path + '/module-tags/'+ 'scripts', 'module-charts' : path + '/module-charts/' +'scripts', 'module-badges' : path + '/module-badges/'+ dist +'scripts', 'module-expenses' : path + '/module-expenses/'+ dist +'scripts', 'module-places' : path + '/module-places/'+ dist +'scripts', 'module-ebilling' : path + '/module-ebilling/'+ dist +'scripts', 'module-transactions' : path + '/module-transactions/'+ dist + 'scripts', 'module-contacts' : path + '/module-contacts/' +'scripts', 'module-spring-transition': path + '/module-spring-transition/'+ dist +'scripts', 'module-devices' : path + '/module-devices/'+ dist +'scripts', 'module-enrollment' : path + '/module-enrollment/'+ dist +'scripts', 'module-behaviors' : path + '/module-behaviors/' +'scripts', 'module-addressbook' : path + '/module-addressbook/'+ dist +'scripts', //idfc lp modules 'idfc-contacts-module' : path + '/idfc-contacts-module/' +'scripts', //'idfc-payments-module' : path + '/idfc-payments-module/'+ dist +'scripts', 'idfc-payments-module' : path + '/idfc-payments-module/'+'scripts', 'idfc-accounts-module' : path + '/idfc-accounts-module/' +'scripts', 'idfc-country-codes' : path + '/idfc-country-codes/' +'scripts', 'idfc-user-attributes' : path + '/idfc-user-attributes/' +'scripts', 'idfc-user-attributes-modified' : path + '/idfc-user-attributes-modified/'+ 'scripts', 'idfc-transactions-module' : path + '/idfc-transactions-module/' +'scripts', 'module-transaction-receipt' : path + '/module-transaction-receipt/scripts', // idfc common 'idfccommon' : path + '/idfc-common/idfc-constants', 'idfcerror' : path + '/idfc-common/idfcerror', /* Xebia Refactoring */ 'idfccommonMb' : path + '/idfc-mobile-common/idfc-constants', 'idfcerrorMb' : path + '/idfc-mobile-common/idfcerror', /* Xebia Refactoring Ending */ 'fileSaver' : path + '/idfc-common/FileSaver', 'idfc-otp-generate' : path + '/idfc-otp-generate/scripts', 'idfc-error-spin' : path + '/idfc-error-spin/scripts', 'idfc-rsa' : path + '/idfc-rsa/scripts', 'module-otp' : path + '/module-bb-otp/scripts', //idfc access control retrofit 'module-access-control' : path + '/idfc-bb-module-access-control/scripts', //idfc utils 'module-idfc-utils' : path + '/module-idfc-utils/scripts', // idfc entitlements 'module-roles' : path + '/idfc-bbe-module-roles/scripts', 'module-rules' : path + '/idfc-bbe-module-rules/scripts', 'module-bb-transactions' : path + '/idfc-bbe-module-transactions/scripts', 'module-workflow-templates': path + '/idfc-bbe-module-workflow-templates/scripts', 'module-entry-limits' : path + '/idfc-bbe-module-entry-limits/scripts', 'module-threshold-limits' : path + '/idfc-bbe-module-threshold-limits/scripts', 'module-widget-templates' : path + '/idfc-bbe-module-widget-templates/scripts', 'module-ucic-details' : path + '/idfc-bbe-module-ucic-details/scripts', // requirejs-plugins 'async' : [ path + '/requirejs-plugins/src/async'], 'goog' : [ path + '/requirejs-plugins/src/goog'], //'idfc-utils-module' : [ path + '/idfc-utils-module/scripts'], 'idfc-utils-module' : [ path + '/idfc-utils-module/scripts'], 'idfc-refresh-module' : [ path + '/idfc-refresh-module/scripts'], 'idfc-otp-module' : [ path + '/idfc-otp-module/scripts'], 'dygraph' : [path + '/dygraph/dygraph'], 'excanvas' : [path + '/excanvas/excanvas'], 'idfc-cq' : path + '/idfc-cq', 'idfc-module-places' : path + '/idfc-module-places/' + 'scripts', //idfc-account-number 'idfc-account-number' : path + '/idfc-account-number/' +'scripts', //idfc-user-otp-prelogin 'idfc-user-otp-prelogin' : path + '/idfc-user-otp-prelogin/' +'scripts', //idfc-mobile-no 'idfc-mobile-no-prelogin' : path + '/idfc-mobile-no-prelogin/' +'scripts', //idfc-country-code 'idfc-country-code-prelogin' : path + '/idfc-country-code-prelogin/' +'scripts', //idfc-debit-card-prelogin 'idfc-debit-card-prelogin' : path + '/idfc-debit-card-prelogin/' +'scripts', //idfc-customer-id 'idfc-customer-id-prelogin' : path + '/idfc-customer-id-prelogin/' +'scripts', 'idfc-user-otp' : path + '/idfc-user-otp/scripts', 'angular-rsa-encrypt' : path + '/angular-rsa-encrypt/angular-rsa-encrypt', 'rsaKeySetup' : path + '/rsaKeySetup/rsaKeySetup', 'idfc-encrypt-api-request' : path + '/idfc-encrypt-api-request/' +'scripts', 'idfc-jsdecrypt' : path + '/idfc-jsdecrypt/' +'scripts', 'idfc-jsdecrypt-file' : path + '/idfc-jsdecrypt/jsdecrypt' }, // Register packages packages: [ 'base', 'core', 'ui', 'mock', 'module-currencies', 'module-accounts', 'module-automation', 'module-estatements', 'module-payments', 'idfc-bb-module-payments', 'module-users', 'module-wealth', 'module-freshness', 'module-tags', 'module-charts', 'module-badges', 'module-expenses', 'module-places', 'module-ebilling', 'module-transactions', 'module-transaction-receipt', 'module-contacts', 'module-spring-transition', 'module-devices', 'module-enrollment', 'module-behaviors', 'module-addressbook', 'idfc-contacts-module', 'idfc-payments-module', 'idfc-utils-module', 'idfc-refresh-module', 'module-idfc-utils', 'module-access-control', 'module-otp', 'module-roles', 'module-rules', 'module-bb-transactions', 'module-workflow-templates', 'module-entry-limits', 'module-threshold-limits', 'module-widget-templates', 'module-ucic-details', 'idfc-otp-module', 'idfc-otp-generate', 'idfc-error-spin', 'idfc-accounts-module', 'idfc-transactions-module', 'idfc-rsa', 'idfc-cq', 'idfc-country-codes', 'idfc-user-attributes', 'idfc-user-attributes-modified', 'idfc-module-places', 'idfc-module-md5', 'idfc-user-otp-prelogin', 'idfc-account-number', 'idfc-mobile-no-prelogin', 'idfc-customer-id-prelogin', 'idfc-debit-card-prelogin', 'idfc-country-code-prelogin', 'idfc-user-otp', 'idfc-encrypt-api-request', 'idfc-jsdecrypt' ], shim: { 'angular': { exports: 'angular' }, 'angular-resource': { deps: ['angular'] }, 'angular-translate': { deps: ['angular'] }, 'd3': { exports: 'd3' }, 'uislider': { exports: 'uislider' }, 'roundslider': { exports: 'roundslider' }, "r2d3" : { deps: ["aight"], exports : "d3" }, 'angular-dynamic-locale': { deps: ['angular'] }, 'reTree': { deps: ['angular'] }, 'ng-device-detector-master': { deps: ['reTree', 'angular'] } }, map: { '*': { 'd3': (function resolveD3Dependency() { return isOldIE() ? 'r2d3' : 'd3'; })() } } }; // helpers // Returns version of IE as a number works for IE version [7, 11) function getInternetExplorerVersion() { var rv = -1; if (navigator && navigator.appName == 'Microsoft Internet Explorer') { var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); if (re.exec(navigator.userAgent || "") != null) { rv = parseFloat(RegExp.$1); } } return rv; } // returns true on IE versions up to 8 function isOldIE() { var ieVersion = getInternetExplorerVersion(); return ieVersion > 0 && ieVersion <= 8; } // shim libraries loaded as